<!doctype html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-model="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .active {
            color:red;
        }
        .bold {
            font-weight:bolder;
        }
    </style>
</head>
<body>
<pre>
    :class="computed"
    computed为计算属性，返回一个样式对象
</pre>
<div id="app">
    <div :class="classComputed">样式</div>
</div>
</body>
<script src="../../vender/vue@2.4.2.js"></script>
<script>

    var app=new Vue({
        el:'#app',
        data:{

        },
        computed:{
            classComputed: function () {
                return {
                    active:Math.random()<0.5,
                    bold:Math.random()>0.5
                }
            }
        }
    });

</script>
</html>